Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gallery): HLS -> HLS.Light #1510

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

feat(gallery): HLS -> HLS.Light #1510

wants to merge 8 commits into from

Conversation

denisx
Copy link
Contributor

@denisx denisx commented Dec 20, 2024

Опишите проблему

  • Импорт HLS заменён на light версию. Функциональности должно хватить.
  • Подгрузка модуля перенесена на попозже, для более лучшей клиентской доступности.

Ожидаемое поведение

Без изменений

Дополнительная информация

Это официально сокращенная сборка, вот её ограничения:

Screenshot 2024-12-20 at 09 39 26

Если по тестам нам хватает функционала, то зачем грузить больше
P.S. На сайте видео-баннер работает работает в такой light-версии, полёт нормальный

Профитность 110 Kb
Screenshot 2024-12-20 at 09 30 03

Вопросы: надо ли добавлять проверку на тип видео, чтобы использовать нативные способы, когда возможно (и не грузить плеер когда и так сработает). Это можно сделать в след.пр.
(
пример логики с сайта:
https://git.moscow.alfaintra.net/projects/ ALFASITE/repos/akit/browse/packages/common/video-background/src/widgets/video-background/utils/attach-media-to-element.ts
)

Copy link

changeset-bot bot commented Dec 20, 2024

🦋 Changeset detected

Latest commit: 6f35815

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@alfalab/core-components-gallery Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@core-ds-bot
Copy link
Collaborator

core-ds-bot commented Dec 20, 2024

Bundle size report

Entry point Size (minified)
gallery/index.js 518.7 (-106.10 KB💚)

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

hls.on(Hls.Events.ERROR, (_, data) => {
async function initHls() {
const { default: Hls } = await import(
/* webpackChunkName: "hls-js-video" */ 'hls.js/dist/hls.light.mjs'
Copy link
Contributor Author

@denisx denisx Dec 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

300 Kb в отдельный чанк

@denisx denisx changed the title Feat/ds 7758 34 feat(gallery): HLS -> HLS.Light Dec 21, 2024
@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@denisx denisx marked this pull request as ready for review December 21, 2024 11:57
@SiebenSieben
Copy link
Contributor

@temss-front

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

перенести в hls.d.ts как в module.d.ts

if (playerRef.current) {
hls.attachMedia(playerRef.current);
}
}

initHls().catch();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

может добавим количество попыток загрузки?


hls = new Hls();

if (!Hls.isSupported()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

проверка до загрузки

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants